#ifndef GAMEENGINE_GRAPHICS_SCENE_SCENE_ELEMENT_H
#define GAMEENGINE_GRAPHICS_SCENE_SCENE_ELEMENT_H

#include <GameEngine/Graphics/graphics_settings.h>


#ifdef GAMEENGINE_NAMESPACES
namespace GameEngine {
#endif

class Scene;
template <class T> class Line3d;


//! Base class for all objects that can be drawn in a scene
/*!
 *  A scene element must reimplement the draw() function
 */
class _Graphics_decl SceneElement {

public:
	//! Enumerates the types of light elements
	enum ElementType {
		//! Elements that represent scene lights
		LightElement = 0,
		//! Elements that represent some opaque geometry
		GeometryOpaqueElement = 1,
		//! Elements that represent some transparent geometry
		GeometryTransparentElement = 2,
		//! Number of element types
		NumberElementTypes = 3
	};

public:
	SceneElement(ElementType type=GeometryOpaqueElement);
	SceneElement(const SceneElement& rhs);
	virtual ~SceneElement();
	SceneElement& operator=(const SceneElement& rhs);

	virtual bool prepare_draw();
	virtual bool finish_draw();

	//! Draw the scene element
	/*!
	 @param ray The picking ray under the mouse
	 @return True if the scene element could correctly be drawn, false otherwise
	 */
	virtual bool draw(const Line3d<float>& ray) = 0;

	ElementType type() const;

protected:
	ElementType& type();

protected:
	//! The type of the element
	/*!
	 *  This type determines the order in which the scene element will be drawn
	 */
	ElementType type_;
};


#ifdef GAMEENGINE_NAMESPACES
} // namespace GameEngine
#endif

#endif
